package com.wqz.service.impl;

import com.wqz.dao.UserDao;
import com.wqz.pojo.User;
import com.wqz.service.UserServiceDao;
import com.wqz.utils.MyBatisUtil;

import java.util.List;

public class UserServiceDaoImpl implements UserServiceDao {

    @Override
    public List<User> findUser(String userName, int gender) throws Exception {

        UserDao userDao = MyBatisUtil.createSqlSession().getMapper(UserDao.class);
        return userDao.findUser(userName, gender);
    }

    @Override
    public User findUserById(Integer id) throws Exception {

        UserDao userDao = MyBatisUtil.createSqlSession().getMapper(UserDao.class);
        return userDao.findUserById(id);
    }

    @Override
    public List<User> findUserListById(Integer id) throws Exception {
        UserDao userDao = MyBatisUtil.createSqlSession().getMapper(UserDao.class);
        return userDao.findUserListById(id);
    }
}
